﻿@using Fyp.Models;
@{
    Layout = "~/Shared/_layoutPage.cshtml";
   var PageTitle = "ProjectList";

    var data = (List<Plist>)@ViewData["data"];

}
@section title
{
 @PageTitle
}
<link rel="stylesheet" type="text/css" href="~/Styles/template.css" media="screen">
<style>
table, td, th
{
border:1px solid green;
padding:2px;
}
th
{
background-color:green;
color:white;
padding:2px;
}
</style>
<div id="main" class = "background">
 <strong>
            <div id="content"  style="margin-left: 32x;margin-bottom: -23px;">
                 <h2 style="text-align: center;">View Student</h2>
             </div>
    </strong>   
@using (Html.BeginForm("SearchProject", "ReserveProject", FormMethod.Post))
{ 
     <input type ="text" id="search" name="search" placeholder ="Search projects..." style="width: 150px;margin-top: -32px; margin-left: 708px;" />
     <input type="submit"  value="Search"  class ="buttonSave" style="margin-left: 861px;margin-top: -32px;height: 20px; width: 59px;padding: 0px; padding-right: -21px;padding-left: -50px;" />
}

    <table border="1" style="margin-left:23px; margin-bottom: 10px">
        <thead>
           <tr>
               <th class="table">Project Title</th>
               <th class="table">Advisor Name</th>
               <th class="table">Student Name</th>
               <th class="table">Roll No</th>
               <th class="table">Email</th>
               <th class="table">Project Status</th>
              @if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("Advisor"))
               {
                     @*<th class="table"></th>*@
               }
               else if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("ProjectOffice"))
               {
                     @*<th class="table"></th>*@
               }
               else
               {
                     <th class="table">Edit</th>
               }
              
           </tr>
        </thead>
       <tbody>
       
       @foreach (var row in data)
       {
            <tr>
               
                   <td class="table"> @row.Title</td>

               <td class="table"> @row.AdvisorName</td>

               <td class="table"> @row.Std_Name</td>

                <td class="table">@row.Std_RollNo</td>

                <td class="table">@row.Std_Email</td>
                <td class="table">@row.status</td>

              @if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("Advisor"))
               {
                 
                  @*<td class="table"></td>*@
               }
              else if (WebSecurity.IsAuthenticated && Roles.IsUserInRole("ProjectOffice"))
              {
                  @*<td class="table"></td>*@
              }
              else
              {
                  <td class="table">@Html.ActionLink("Edit", "EditProject", new { id=row.projId }) </td>
              }
            
            </tr>
       }
        
       </tbody>
   </table>
    </div>
       
              
          
       
         
